-- msg_execute_script
-- Create by weism
-- 请求执行一段脚本

return function(lpc)
    local old = print;
    print = function(msg)
        old(msg);
        Communicate.send("CMD_EXECUTE_SCRIPT", {["result"] = msg, });
    end

    local script = lpc.script;
    local f = function()
        loadstring(script)();
    end
    local _, err = pcall(f);
    if nil ~= err then
        print("执行失败：" .. err);
    end

    -- 执行完毕，退回去
    print = old;
end
